<!--消息详情-->
<template>
  <scroller class="scroller bg1">
    <div v-if="notice">
      <text class="font36 text2">{{notice.title}}</text>

      <div class="height10"></div>
      <text class="font22 text3">{{notice.showTime}}</text>

      <div class="height30"></div>
      <text class="font26 text3">{{notice.content}}</text>
      
      <div class="height40"></div>
      <text class="font26 text3">{{notice.author}}</text>
    </div>
  </scroller>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
.scroller{
  flex: 1;
  padding:40px;
}
</style>

<script>

import jhttps from "@/_js/https"; ;
import jtime from "@/_js/time";

const weexFunction = weex.requireModule("WeexFunction");

import I18N from "@/_i18n/i18n";
var T = I18N.t;
weexFunction.setTitle(T("消息详情"));

export default {
  
  data() {
    return {

      noticeId:'', //消息Id
      type:'', //消息类型

      notice: undefined
    };
  },

  created(){

    var param = weex.config;
    this.noticeId = parseInt(param.noticeId);
    this.type = param.type;

    this.httpNoticeDetail();
  },

  methods: {

    
    /********************************* HTTP*/
    //消息详情请
    httpNoticeDetail(){
      
      var param = {'messageId':this.noticeId,
                   'type':this.type};
      jhttps.post("systemV2/queryAnnouncementDetail",param,true,(data)=>{
        if(data.status == 200){
          data = data.data;
          data.showTime = jtime.getTime(data.showTime, 'y/M/d H:m');
          this.notice = data;
        }else{
          jmodal.toast(data.msg);
        }
      });
    }
  }
};
</script>
